<!DOCTYPE html>
<!--[if IE 8]>
	<html xmlns="http://www.w3.org/1999/xhtml" class="ie8" lang="zh-CN">
<![endif]-->
<!--[if !(IE 8) ]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name='robots' content='noindex,follow' />
<title>${site.name!}-注册</title>
<link rel="stylesheet" href="${url}/template/themes/${site.theme}/css/login.css" type="text/css" media="all" />
</head>
<body class="login login-action-login wp-core-ui locale-zh-cn">
	<div id="login">
		<p id="_msg" style="color:red;padding-left:60px;">${error!}</p>
		<form name="loginForm" id="loginForm" action="${url}/user/doRegist" method="post">
			<p>
				<label for="email">邮箱<br />
				<input type="text" name="email" id="email" class="input" value="" size="50" /></label>
			</p>
			<p>
				<label for="username">用户名<br />
				<input type="text" name="username" id="username" class="input" value="" size="30" /></label>
			</p>
			<p>
				<label for="password">密码<br />
				<input type="text" name="password" id="password" class="input" value="" size="32" /></label>
			</p>
			<ul class="tin-open">
				<li><a class="qq" href="${url}/user/gosso?connect=qq&redirect=${url}" title="使用QQ账号登录"></a> </li>
				<li><a class="weibo" href="${url}/user/gosso?connect=weibo&redirect=${url}" title="使用微博账号登录"></a> </li>
			</ul>
			<p class="submit">
				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="注册" />
			</p>
		</form>
		<p id="nav">
			<a href="${url}/user/login">登录</a> | <a href="${url}/user/goFindPwd" title="找回密码">忘记密码？</a>
		</p>
		<p id="backtoblog"><a href="${url}" title="不知道自己在哪？">&larr; 回到【${site.name}】</a></p>
	</div>
	<div class="clear"></div>
<script type="text/javascript" src='${url}/js/jquery1.11.0.min.js'></script>
<script type="text/javascript" src='${url}/js/jquery.validate.min.js'></script>
<script type="text/javascript" src='${url}/js/jquery.form.min.js'></script>
<script type="text/javascript">
jQuery(function($) {
	$('#loginForm').validate({
		rules:{
			username:{
				required: true,
				rangelength: [6,32],
				remote:{
					type:"post",
					url: "${url}/ajax/userExist?time="+ (new Date()).getTime(),
					data:{key:function(){return $.trim($("#email").val());}},
					dataType:"json",
					dataFilter: function(data) {
						if (data=="true")
                    		return true;
                    	else
                        	return false;
                	}
				}
			},
			password:{
				required: true,
				rangelength: [6,32]
			},
			email:{
				required: true,
				email:true,
				remote:{
					type:"post",
					url: "${url}/ajax/emailExist?time="+ (new Date()).getTime(),
					data:{key:function(){return $.trim($("#email").val());}},
					dataType:"json",
					dataFilter: function(data) {
						if (data=="true")
                    		return true;
                    	else
                        	return false;
                	}
				}
			}
		},
		messages:{
			username:{
				required: "请输入用户名！",
				rangelength:"用户名长度必须在6-32个字符之间！",
				remote: "用户名存在，不可用！"
			},
			email:{
				required: "请输入邮箱！",
				email:"请输入合法的email地址！",
				remote: "邮箱存在，不可用！"
			},
			password: {
				required: "请输入密码！",  
				rangelength: "密码必须在6-32个字符之间！"
			}
		},
		showErrors : function(errorMap, errorList) {  
			var msg = '';  
			$.each(errorList, function(i, v) {  
				msg += (v.message + '\r\n'); 
				return false; 
			});  
			$("#_msg").text(msg);
		},  
		/* 失去焦点时不验证 */  
		onfocusout : false  
	});
});
</script>
</body>
</html>